package com.it.flowable.util;

import org.flowable.bpmn.model.FormProperty;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class DataUtils {

    /**
     * 表单属性
     */
    public static List<FormProperty> createSubmitFormProperties() {
        return Arrays.asList(
                FormUtils.createEnumProperty("leaveType", "请假类型", "ANNUAL", "年假", "SICK", "病假"),
                FormUtils.createDateProperty("startDate", "开始日期"),
                FormUtils.createDateProperty("endDate", "结束日期"),
                FormUtils.createStringProperty("reason", "请假事由", true)
        );
    }

    /**
     * 创建审批表单属性
     */
    public static List<FormProperty> createApprovalFormProperties() {
        return Arrays.asList(
                FormUtils.createEnumProperty("approveResult", "审批结果", "APPROVE", "通过", "REJECT", "驳回"),
                FormUtils.createStringProperty("comment", "审批意见", false)
        );
    }

    /**
     * 创建HR表单属性
     */
    public static List<FormProperty> createHrFormProperties() {
        List<FormProperty> properties = new ArrayList<>(createApprovalFormProperties());
        properties.add(FormUtils.createEnumProperty("complianceCheck", "合规检查", "PASS", "合规", "FAIL", "不合规"));
        return properties;
    }

}
